package com.be.beadmin.system.task;

import com.be.beadmin.service.task.BaseTask;
import com.be.beadmin.service.util.BeanUtil;

import java.util.List;

/**
 * @Description:
 * @author: Jiaming Zheng
 * @Date: Create in 15:04 2023/12/7
 * @Modified By:
 **/
public class IssueWorkOrderTask extends BaseTask {

    private List<String> productIds;
    public IssueWorkOrderTask(List<String> productIds) {
        super("下发工单任务");
        this.productIds = productIds;
    }

    /**
     * @description 执行任务
     */
    @Override
    public void doTask() {
        try {
            BeanUtil.getBean(TaskProcessor.class).issueWorkOrderTask(productIds);
        } catch (Exception e) {
            logger.error(String.format("任务[%s]执行出错", getName()), e);
        }
    }
}
